﻿using System.ComponentModel.DataAnnotations;
using AllIsWell.Core.Models;
using AllIsWell.Tests.TestData;
using NUnit.Framework;

namespace AllIsWell.Core.Tests.Models
{
    [TestFixture]
    class DestinyTests : ModelTests
    {
        private Destiny _destiny;

        [SetUp]
        public void SetUp()
        {
            _destiny = DestinySeed.GetDestiny(1);    
        }

        [Test]
        [ExpectedException(typeof(ValidationException), ExpectedMessage = "A Path is required")]
        public void PathIsRequired()
        {
            _destiny.Path = "";

            ValidateModel(_destiny);
        }

        [Test]
        [ExpectedException(typeof(ValidationException), ExpectedMessage = "A Description is required")]
        public void DescriptionIsRequired()
        {
            _destiny.Description = "";

            ValidateModel(_destiny);
        }

        [Test]
        [ExpectedException(typeof(ValidationException), ExpectedMessage = "A Greeting message is required")]
        public void GreetingMessageIsRequired()
        {
            _destiny.GreetingMessage = "";

            ValidateModel(_destiny);
        }
    }
}
